package View;

import java.text.ParseException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class JFrmPrincipal extends javax.swing.JFrame {

    public JFrmPrincipal() {
        initComponents();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jBtnCadastro = new javax.swing.JButton();
        jBtnProduto = new javax.swing.JButton();
        jBtnCompra = new javax.swing.JButton();
        jBtnRelatorio = new javax.swing.JButton();
        jBtnVender = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Controle Empresa");
        setResizable(false);

        jBtnCadastro.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/ic_person_add_black_24dp.png"))); // NOI18N
        jBtnCadastro.setText("Cadastrar Cliente");
        jBtnCadastro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnCadastroActionPerformed(evt);
            }
        });

        jBtnProduto.setText("Cadastrar Produto");
        jBtnProduto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnProdutoActionPerformed(evt);
            }
        });

        jBtnCompra.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/ic_add_shopping_cart_black_24dp.png"))); // NOI18N
        jBtnCompra.setText("Comprar produtos ");
        jBtnCompra.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnCompraActionPerformed(evt);
            }
        });

        jBtnRelatorio.setText("Relatórios");
        jBtnRelatorio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnRelatorioActionPerformed(evt);
            }
        });

        jBtnVender.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/ic_pages_black_24dp.png"))); // NOI18N
        jBtnVender.setText("Vender Itens");
        jBtnVender.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnVenderActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(150, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jBtnCadastro, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBtnProduto, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBtnCompra, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)
                    .addComponent(jBtnRelatorio, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jBtnVender, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(143, 143, 143))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addComponent(jBtnCadastro)
                .addGap(18, 18, 18)
                .addComponent(jBtnProduto)
                .addGap(18, 18, 18)
                .addComponent(jBtnCompra)
                .addGap(18, 18, 18)
                .addComponent(jBtnRelatorio)
                .addGap(18, 18, 18)
                .addComponent(jBtnVender)
                .addContainerGap(37, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jBtnCadastroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnCadastroActionPerformed
        JFrmCliente cliente = null;
        try {
            cliente = new JFrmCliente();
        } catch (ParseException ex) {
            Logger.getLogger(JFrmPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
        cliente.setVisible(true);
    }//GEN-LAST:event_jBtnCadastroActionPerformed

    private void jBtnProdutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnProdutoActionPerformed
        JFrmProduto produto = new JFrmProduto();
        produto.setVisible(true);
    }//GEN-LAST:event_jBtnProdutoActionPerformed

    private void jBtnCompraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnCompraActionPerformed
        JFrmCompraProduto comProduto = new JFrmCompraProduto();
        comProduto.setVisible(true);
    }//GEN-LAST:event_jBtnCompraActionPerformed

    private void jBtnVenderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnVenderActionPerformed
        JFrmSelecionaCliente slCliente = new JFrmSelecionaCliente();
        slCliente.setVisible(true);
    }//GEN-LAST:event_jBtnVenderActionPerformed

    private void jBtnRelatorioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnRelatorioActionPerformed
        JFrmRelatoriosAbas relatorios = new JFrmRelatoriosAbas();
        relatorios.setVisible(true);
    }//GEN-LAST:event_jBtnRelatorioActionPerformed

    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(JFrmPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(JFrmPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(JFrmPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(JFrmPrincipal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new JFrmPrincipal().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBtnCadastro;
    private javax.swing.JButton jBtnCompra;
    private javax.swing.JButton jBtnProduto;
    private javax.swing.JButton jBtnRelatorio;
    private javax.swing.JButton jBtnVender;
    // End of variables declaration//GEN-END:variables
}
